package org.dtrd.modules.suggest.entity.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;
import lombok.Getter;
import lombok.Setter;
import org.dtrd.modules.suggest.entity.bean.SigninRecordSuggestDetail;


/**
 * <p>
 * 打卡记录建议表
 * </p>
 *
 * @author sun
 * @since 2022-08-03
 */
@Getter
@Setter
@TableName("dtrd_ent_rd_signin_record_suggest")
public class DtrdEntRdSigninRecordSuggest {

    @TableId(value = "data_id", type = IdType.AUTO)
    private Integer dataId;

    /**
     * 打卡项目:1 血糖；2血压；3运动；4用药；5 饮食；6 体重；7腰围；8尿酮；9 胰岛素；10睡眠
     */
    @TableField("signin_type")
    private Integer signinType;

    /**
     * 打卡日期
     */
    @TableField("record_date")
    private String recordDate;

    /**
     * 打卡记录id
     */
    @TableField("record_id")
    private Integer recordId;

    /**
     * 患者id
     */
    @TableField("patient_id")
    private Integer patientId;

    /**
     * 医生id
     */
    @TableField("suggest_doctor_id")
    private Integer suggestDoctorId;

    /**
     * 建议
     */
    @TableField("suggest")
    private String suggest;

    /**
     * 评分，多个评分项按,分隔
     */
    @TableField("score")
    private String score;

    @TableField("create_time")
    private Date createTime;

    @TableField("is_del")
    @TableLogic
    private Integer isDel;

    public DtrdEntRdSigninRecordSuggest init() {
        createTime = new Date();
        isDel = 0;
        return this;
    }

    public DtrdEntRdSigninRecordSuggest parseFromDto(SigninRecordSuggestDetail dto) {
        dataId = dto.getDataId();
        signinType = dto.getSigninType();
        recordDate = dto.getRecordDate();
        recordId = dto.getRecordId();
        patientId = dto.getPatientId();
        suggestDoctorId = dto.getSuggestDoctorId();
        suggest = dto.getSuggest();
        score = dto.getScore();
        return this;
    }


}
